﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace SponsorshipManager.Domain
{
    /// <summary>
    /// The basic domain object.
    /// </summary>
    public abstract class DomainObject
    {


        Guid _guid;
        virtual public  List<Property> Properties
        {
            get;
            set;
        }
        
        /// <summary>
        /// The primary key of a domain object.
        /// </summary>
        /// [Required(ErrorMessage = "The Primary Key cannot be null.")]
        /// 
        virtual public Guid PrimaryKey 
        {
            get
            {
                if(Guid.Empty == _guid)
                    _guid = Guid.NewGuid();
                return _guid;
            }
            set
            {
                _guid = value;
            }
        }

        public Dictionary<string,object> AdditionalField;

    }
}
